package com.kunyi.web.service.log.core.transform;

import com.kunyi.web.service.log.entity.domain.LogSys;
import com.kunyi.web.service.log.entity.resp.LogSysDetailResp;
import com.kunyi.web.service.log.entity.resp.LogSysListResp;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @ClassName LogSysTransform
 * @Description log_sys相关对象转换
 * @Author pengjunjun
 * @Date 2024/3/6 16:16
 * @Version 1.0
 **/
public class LogSysTransform {

    /**
     * @return LogSysListResp
     * @Author pengjunjun
     * @Description LogSys -> LogSysListResp
     * @Date 16:28 2024/3/6
     * @Param logOps:
     **/
    public static LogSysListResp log2ListResp(LogSys logSys) {
        return new LogSysListResp()
                .setId(logSys.getId().toString())
                .setCode(logSys.getCode())
                .setEnvType(logSys.getEnvType())
                .setEnvLevel(logSys.getEnvLevel())
                .setEnvName(logSys.getEnvName())
                .setCreateTime(logSys.getCreateTime());
    }

    /**
     * @Author pengjunjun
     * @Description logSys -> LogSysDetailResp
     * @Date 18:19 2024/3/6
     * @Param logSys:
     * @return LogSysDetailResp
     **/
    public static LogSysDetailResp log2DetailResp(LogSys logSys) {
        return new LogSysDetailResp()
                .setCode(logSys.getCode())
                .setEnvType(logSys.getEnvType())
                .setEnvLevel(logSys.getEnvLevel())
                .setEnvName(logSys.getEnvName())
                .setEnvDetail(logSys.getEnvDetail())
                .setCreateTime(logSys.getCreateTime());
    }
}
